Skip to content

Remove cosmiconfig#1553

Closed
robhogan wants to merge 1 commit into
mainfrom
pr1553
Closed

Remove cosmiconfig#1553
robhogan wants to merge 1 commit into
mainfrom
pr1553

Conversation

@robhogan

@robhogan robhogan commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Reimplement the small pieces of cosmiconfig we need to make config loading work as it always has, while dropping a fairly complex and out-of-date dependency.

This is intended to be fully behaviour-preserving.

YAML support

Metro has always had YAML config support in a fashion, but only if the config file is explicitly specified (eg via --config=foo.yaml).
Because it's likely very little used, it has no ability to express JS functions, sets or maps, and has no type checking, and requires a dependency on a YAML parser, this change marks it deprecated with a console warning (since at this stage, we have no reporter). Once we remove YAML support, loading config becomes extremely simple.

Changelog:

 - **[Deprecated]** Specifying a YAML `-- config` file

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 12, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this in D80083881.

Summary:
Reimplement the small pieces of `cosmiconfig` we need to make config loading work as it always has, while dropping a fairly [complex](https://npmgraph.js.org/?q=cosmiconfig%405.2.1) and out-of-date dependency.

This is intended to be fully behaviour-preserving.

## YAML support
Metro has always had YAML config support in a fashion, but only if the config file is explicitly specified (eg via `--config=foo.yaml`).

Because it's likely very little used, it has no ability to express JS functions, sets or maps, and has no type checking, and requires a dependency on a YAML parser, this change marks it deprecated with a console warning (since at this stage, we have no reporter). Once we remove YAML support, loading config becomes extremely simple.

Changelog: Internal


Test Plan:
- New/rewritten tests
 -

Reviewed By: huntie

Differential Revision: D80083881

Pulled By: robhogan
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80083881

@robhogan robhogan marked this pull request as ready for review August 14, 2025 18:42
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@robhogan merged this pull request in 40a4470.

@robhogan robhogan mentioned this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants